package start;

import control.Values;
import tryout.MyEventTable;
import tryout.MyTableTester;
import xml.XMLWorker;
import gui.config.ConfigPanel;
import gui.config.DetailEditor;
import gui.config.EventTable;
import gui.config.FilterArea;
import gui.config.MainFrame;

public class Configuration {

	public static void main(String[] args) {
		Configuration c = new Configuration();
	}
	
	public Configuration() {
		// lese Daten
		XMLWorker worker = new XMLWorker();
		worker.readXML("data/data.xml");
		Values.setWorker(worker);
		// initialisiere GUI
		MainFrame mainFrame = new MainFrame();
		Values.setMainFrame(mainFrame);
		// DetailEditor
		DetailEditor detailEditor = new DetailEditor();
		mainFrame.setDetailEditor(detailEditor);
		Values.setDetailEditor(detailEditor);
		// EventTable
		EventTable eventTable = new EventTable();
		mainFrame.setEventTable(eventTable);
		Values.setEventTable(eventTable);
		// ConfigPanel
		ConfigPanel configPanel = new ConfigPanel();
		mainFrame.setConfigPanel(configPanel);
		Values.setConfigPanel(configPanel);
		// FilterArea
		FilterArea filterArea = new FilterArea();
		mainFrame.setFilterArea(filterArea);
		// Beobachter anmelden
		worker.logOn(detailEditor);
		worker.logOn(eventTable);
		// GUI sichtbar machen
//		mainFrame.setVisible(true);
		
		MyTableTester myEventTable = new MyTableTester();
	}

}
